﻿using COC.Constant;
using UnityEngine;
using System.Collections;
namespace COC.UIAction { 
public class CampAction : BaseAction {

    AsyncOperation async;
    public UILabel colliderInfo;
    static string colliderMsg;
    static string selectionMsg;
	// Use this for initialization
	void Start () {
      
	}
	
	// Update is called once per frame
	void Update () {
        if (UICamera.selectedObject !=null&& UICamera.selectedObject.name == CommonConstants.CAMPS_SHOW_BATTLE_UI_BTN)
        {
            if (async == null)
            {

                async = Application.LoadLevelAsync(CommonConstants.LOAD_BATTLE_SCENE);
            }
          
        }
        if (async != null)
        {
            if (async.isDone)
            {
                //Destroy(GameObject.FindGameObjectWithTag(CommonConstants.BUILD_MODEL_TAG));
                async.allowSceneActivation = true;
            }
        }
	    {
	        
	    }

	}
    
    public static void  setColliderInfo(string info)
    {
        colliderMsg = info;
    }
    public static void setSelectionObjectName(string name)
    {
        selectionMsg = name;
    }
    void OnGUI()
    {
        GUI.Label(new Rect(Screen.width - 200, 40, 220, 20), "Selection: "+selectionMsg);
        GUI.Label(new Rect(Screen.width - 200, 60, 220, 20), "Collider: "+colliderMsg);
       // colliderInfo.text = "Collider:"+colliderMsg;
       // colliderInfo.fontSize = 40;

    }
}
}